<template>
  <div class="Swiper">
    <div class="swiper">
		<div class="swiper-wrapper">
			<div class="swiper-slide" 
				v-for="(item,index) in list" 
				:key="index"
			>
				<img :src="item.imgUrl" alt="">
			</div>
		</div>
		<!-- 如果需要分页器 -->
		<div class="swiper-pagination"></div>
    </div>
  </div>
</template>
<script>
import "swiper/css/swiper.css";
import Swiper from "swiper";
export default {
  name: "Swiper",
  props:{
    list:Array,
  },
  mounted() {
    new Swiper(".swiper", {
      loop: true, // 循环模式选项
      // 如果需要分页器
      pagination: {
        el: ".swiper-pagination",
      },
    });
  },
};
</script>

<style lang="less">

.Swiper {
  overflow: hidden;
  margin-bottom: .3rem;
  .swiper {
    width: 100%;
    position: relative;
    img {
      width: 100%;
      background-size: cover;
    }
  }
}
</style>